﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.hud {
    import flash.utils.*;
    import org.aswing.*;
    import Classes.*;
    import Display.*;
    import Display.aswingui.*;

    public class CommodityPopupView extends NotifyPopupView {

        protected var m_commodityName:String;
        protected var m_commodityText:JTextField;
        private var m_amount:int;
        private var m_cap:int;
        private var m_friendlyName:String;

        public function CommodityPopupView(_arg1:Dictionary, _arg2:String){
            this.m_commodityName = _arg2;
            super(_arg1, "", "", TYPE_OK, null);
        }
        override protected function makeShortPanel():JPanel{
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
            var _local2:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER);
            this.m_amount = Global.player.commodities.getCount(this.m_commodityName);
            this.m_cap = Global.player.commodities.getCapacity(this.m_commodityName);
            this.m_friendlyName = ZLoc.t("Main", (("Commodity_" + this.m_commodityName) + "_friendlyName"));
            var _local3:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
            var _local4:JTextField = ASwingHelper.makeTextField((this.m_friendlyName + ": "), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 14, 2531789);
            this.m_commodityText = ASwingHelper.makeTextField((((("" + this.m_amount) + "/") + this.m_cap) + "  "), EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 12, 5785234);
            _local3.appendAll(_local4, this.m_commodityText);
            ASwingHelper.prepare(_local3);
            var _local5:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
            var _local6:JTextField = ASwingHelper.makeTextField("(Click for details) ", EmbeddedArt.DEFAULT_FONT_NAME_BOLD, 10, 2531789);
            _local5.append(_local6);
            ASwingHelper.prepare(_local5);
            _local2.appendAll(_local3, _local5);
            ASwingHelper.prepare(_local2);
            _local1.appendAll(_local2, ASwingHelper.horizontalStrut(25));
            ASwingHelper.prepare(_local1);
            return (_local1);
        }
        public function forceUpdateValue(_arg1:int):void{
            this.m_commodityText.setText((((("" + _arg1) + "/") + this.m_cap) + " "));
        }

    }
}//package Display.hud 
